package com.ecode.ecny.mobel;

import com.ecode.ecny.uitl.DateTimeUtil;
import com.ecode.ecny.base.AppContext;
import com.ecode.ecny.base.ReqHead;
import lombok.Data;

/**
 * @ClassName ImspectDo
 * @Author mjlft
 * @Date 2021/8/14 22:43
 * @Version 1.0
 * @Description 交易堵重实体
 */
@Data
public class InspectDo {
    //请求码
    private String reqNo;
    //发送方
    private String sender;
    //接收方
    private String receiver;
    //交易类型
    private String msgType;
    //报文方向
    private String direct;
    //请求日期
    private String trxDate;
    //请求时间
    private String trxTime;

    public static InspectDo createInstance(ReqHead head, String direct, String msgType) {
        InspectDo inspectDo = new InspectDo();
        inspectDo.setReqNo(head.getReqNo());
        inspectDo.setDirect(direct);
        inspectDo.setMsgType(msgType);
        inspectDo.setSender(head.getSrcSys());
        inspectDo.setReceiver(AppContext.ECNY_SYS);
        inspectDo.setTrxDate(DateTimeUtil.getCurrentDate());
        inspectDo.setTrxTime(DateTimeUtil.getCurrentTime());
        return inspectDo;
    }
}
